from django.db import models


class CsAdmins(models.Model):
    shop_id = models.PositiveIntegerField()
    role_id = models.PositiveIntegerField(default=0)
    device_code = models.CharField(default='', blank=True, max_length=100)
    job_num = models.PositiveIntegerField()
    username = models.CharField(unique=True, max_length=20)
    salt = models.CharField(unique=True, max_length=8)
    password = models.CharField(max_length=32)
    token = models.CharField(max_length=200)
    avatar = models.CharField(default='', blank=True, max_length=200)
    tel = models.CharField(default='', blank=True, max_length=20)
    ip = models.CharField(max_length=15)
    status = models.IntegerField(default=0)
    ver = models.IntegerField(default=0)
    last_login_at = models.PositiveIntegerField(default=0)
    last_logout_at = models.PositiveIntegerField(default=0)
    created = models.PositiveIntegerField()
    updated = models.PositiveIntegerField()
    deleted = models.PositiveIntegerField(default=0)
    w_id = models.IntegerField(default=0)
    parent_user = models.CharField(max_length=255, blank=True, null=True, default='')
    able_class = models.TextField(blank=True, null=True, default='')
    cfg = models.TextField(default='')

    class Meta:
        managed = False
        db_table = 'cs_admins'
